<?php
// $Id$

/**
 * Controller_Download 控制器
 */
class Controller_Download extends Controller_Abstract
{
    function actionIndex() {
        //        header('Content-Type: text/html; charset=utf-8');
        $att_idset = FUNC::getIdset(FUNC::getV('att_idset'));
        //                dump($att_idset);
        foreach($att_idset as $att_id) {
            $att = Attachment::find('att_id = ?', $att_id)->one()->query();
            if($att->id()) {
                $att -> sendfile();
            }
//            sendfile($att_id);
        }
    }

    function actionSetError() {
        $row = array(
            'att_id' => FUNC::getV('att_id'),
            'error_id' => FUNC::getV('error_id'),
        );
        dump($row);
        $this->model_attachment->setError($row);
    }
}


